<template>
  <div id="app">
    <div class="navView">
      <div class="navTitle" v-for="item in list" :key="item.id" @click="handleClick(item.id)">
        {{ item.name }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'navCollege',
  data () {
    return {
      list: [
        { id: 1, name: '雁塔区' },
        { id: 2, name: '长安区' },
        { id: 3, name: '高新区' },
        { id: 4, name: '西咸新区' },
        { id: 5, name: '莲湖区' },
        { id: 6, name: '新城区' },
        { id: 7, name: '高陵区' },
        { id: 8, name: '鄠邑区' }
      ]
    }
  },
  methods: {
    handleClick (id) {
      this.$emit('area-selected', id)
    }
  }
}
</script>

<style scoped>
#app {
  position: absolute;
  height: calc(100vh - 60px);
  z-index: 1;
}

.navView {
  width: 100px;
  margin: 10px 10px 10px 40px;
  /* 圆角 */
  border-radius: 25px;
}

.navTitle {
  width: 100%;
  height: 25px;
  line-height: 25px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 25px;
  border: 1px solid #fed610;
  margin-top: 5px;
  cursor: pointer;
}

.navTitle:hover {
  background-color: #fed610;
}
</style>
